package org.carl.akka.config;

import cn.hutool.extra.spring.EnableSpringUtil;
import org.carl.akka.annotation.EnableAkkaCore;
import org.carl.akka.core.AkkaCoreRunner;
import org.carl.akka.service.AkkaService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@ConditionalOnBean(annotation = EnableAkkaCore.class)
@Configuration
@EnableSpringUtil
public class AkkaAutoConfig {

    @Bean
    public AkkaService akkaService() {
        return new AkkaService();
    }

    @Bean
    public AkkaCoreRunner akkaCoreRunner() {
        return new AkkaCoreRunner();
    }
}
